import request from '@/utils/request'

// 查询库存盘点列表
export function listInventoryCheck(query) {
  return request({
    url: '/ldzl-ck/inventory/stocktaking/list',
    method: 'get',
    params: query
  })
}

// 查询库存盘点详细
export function getInventoryCheck(takingId) {
  return request({
    url: '/ldzl-ck/inventory/stocktaking/' + takingId,
    method: 'get'
  })
}

// 新增库存盘点
export function addInventoryCheck(data) {
  return request({
    url: '/ldzl-ck/inventory/stocktaking',
    method: 'post',
    data: data
  })
}

// 修改库存盘点
export function updateInventoryCheck(data) {
  return request({
    url: '/ldzl-ck/inventory/stocktaking',
    method: 'put',
    data: data
  })
}

// 删除库存盘点
export function delInventoryCheck(takingId) {
  return request({
    url: '/ldzl-ck/inventory/stocktaking/' + takingId,
    method: 'delete'
  })
}

// 查询盘点明细列表
export function listCheckDetails(query) {
  return request({
    url: '/ldzl-ck/inventory/stocktaking/details/list',
    method: 'get',
    params: query
  })
}

// 查询入库记录
export function listInboundRecords(takingId) {
  return request({
    url: '/ldzl-ck/inventory/stocktaking/inbound/' + takingId,
    method: 'get'
  })
}

// 查询出库记录
export function listOutboundRecords(takingId) {
  return request({
    url: '/ldzl-ck/inventory/stocktaking/outbound/' + takingId,
    method: 'get'
  })
}

// 查询操作记录
export function listOperationRecords(takingId) {
  return request({
    url: '/ldzl-ck/inventory/stocktaking/operation/' + takingId,
    method: 'get'
  })
}

// 提交盘点单
export function submitCheck(takingId) {
  return request({
    url: '/ldzl-ck/inventory/stocktaking/submit/' + takingId,
    method: 'put'
  })
}

// 审核盘点单
export function approveCheck(data) {
  return request({
    url: '/ldzl-ck/inventory/stocktaking/approve',
    method: 'put',
    data: data
  })
}

// 取消盘点单
export function cancelCheck(takingId) {
  return request({
    url: '/ldzl-ck/inventory/stocktaking/cancel/' + takingId,
    method: 'put'
  })
} 